package com.glodon.paas.account.dao.domain;

import com.glodon.paas.account.api.bean.Address;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

@Entity(value = "address", noClassnameStored = true)
public class AddressEntity{
	
	public static Address getDto(AddressEntity e){
		if(e == null){
			return null;
		}
		else{
			Address d = new Address();
			d.setAddress(e.getAddress());
			d.setCity(e.getCity());
			d.setScity(e.getScity());
			d.setUserId(e.getUserId());
			d.setZipcode(e.getZipcode());
			return d;
		}
	}
	
	@Id
	private String id;
	private String userId;	//新增加，还未使用
	private String zipcode;	
	private String address;	
	private String city;
	private String scity;
	
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getScity() {
		return scity;
	}
	public void setScity(String scity) {
		this.scity = scity;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
//	public AddressEntity translate() {
//		AddressEntity addr = new AddressEntity();
//		addr.address = this.address;
//		addr.city = UserInfoMappingUtil.getValue(this.city);
//		addr.scity = UserInfoMappingUtil.getValue(this.scity);
//		addr.zipcode = this.zipcode;
//		return addr;
//	}
}
